/**
 * 预约记录
 * 1. 审核预约
 *  1.1. 审核通过
 *  1.2. 审核不通过
 *  1.3. 审核中
 *  1.4. 撤销预约
 * 2. 取消预约
 *  2.1. 取消预约
 *  2.2. 取消中
 *  2.3. 已取消
 *  2.4. 撤销预约
 */

function main(params) {
    // NORMAL 普通状态
    // HIDDEN 隐藏状态
    // DISABLED 禁用状态

    let appointmentStateName = params.appointment_state_type_name.value;
    let verifyStateName = params.verify_state_name.value;
    let behavior = "HIDDEN";

    if( verifyStateName === '已撤销' || verifyStateName === '已过期'){
        behavior = "HIDDEN";
    }else if( verifyStateName === '审核通过'){
        this._props.button.title = '取消预约申请';
        behavior = "NORMAL";
    }else if( verifyStateName === '审核不通过'){
        this._props.button.title = '查看详情';
        behavior = "NORMAL";
    }else if( verifyStateName === '待审核'){
        this._props.button.title = '撤销预约申请';
        behavior = "NORMAL";
    }
    return behavior;
}


function main(params) {
    // NORMAL 普通状态
    // HIDDEN 隐藏状态
    // DISABLED 禁用状态
    debugger
    let appointmentStateName = params.appointment_state_type_name.value;
    let verifyStateName = params.verify_state_name.value;
    let behavior = "HIDDEN";

    if( verifyStateName === '已撤销' || verifyStateName === '已过期'){
        behavior = "HIDDEN";
    }else if( verifyStateName === '审核通过'){
        this._props.button.title = '取消预约';
        this.$children[0].$children[0].$children[0]._props.button.title = '取消预约'
        behavior = "NORMAL";
    }else if( verifyStateName === '审核不通过'){
        this._props.button.title = '查看详情';
        this.$children[0].$children[0].$children[0]._props.button.title = '查看详情'
        behavior = "NORMAL";
    }else if( verifyStateName === '待审核'){
        if(appointmentStateName === '取消预约申请'){
            this._props.button.title = '撤销取消预约';
            this.$children[0].$children[0].$children[0]._props.button.title = '撤销取消预约'
        }else if(appointmentStateName === '预约申请'){
            this._props.button.title = '撤销预约';
            this.$children[0].$children[0].$children[0]._props.button.title = '撤销预约'
        }

        behavior = "NORMAL";
    }
    return behavior;
}



